<script type="text/javascript" src="{$smarty.const.URL_JS}/category.js"></script>
<div class="clearfix" id="cat_path">
<table cellpadding="0" border="0" class="cat_path_in_productpage">
	<tr>
	{if $selected_category.picture}
	<td><img src="{$smarty.const.URL_PRODUCTS_PICTURES}/{$selected_category.picture|escape:'url'}" alt="{$selected_category.name|escape:'html'}" title="{$selected_category.name|escape:'html'}" >
	</td>
	{/if}
	<td><a href="{"?"|set_query}">{"lnk_homepage"|translate}</a>&nbsp;{$BREADCRUMB_DELIMITER}
		{section name=i loop=$product_category_path}
		{if $product_category_path[i].categoryID != 1}
		<a href='{"?categoryID=`$product_category_path[i].categoryID`&category_slug=`$product_category_path[i].slug`"|set_query_html}'>{$product_category_path[i].name|escape:'html'|default:"(no name)"}</a>{if !$smarty.section.i.last}&nbsp;{$BREADCRUMB_DELIMITER}{/if}
		{/if}
		{/section}
	</td>
	</tr>
	</table>
	</div>
	<div class="clearfix" id="cat_top_tree">
{debug}
{*
@features "Search products by params"
*}
		{if $allow_products_search}
		{include file="advanced_search_in_category.tpl.html"}
		{/if}
{*
@features
*}
		<div id="cat_info_left_block">
		{* description *}
		{$selected_category.description}
		{if $subcategories_to_be_shown}
		{* show subcategories *}
		<p>{section name=i loop=$subcategories_to_be_shown}
		{if $subcategories_to_be_shown[i][3]}
			{assign var=_sub_category_url value="?categoryID=`$subcategories_to_be_shown[i][0]`&category_slug=`$subcategories_to_be_shown[i][3]`"|set_query_html}
		{else}
			{assign var=_sub_category_url value="?categoryID=`$subcategories_to_be_shown[i][0]`"|set_query_html}
		{/if}
		 <a href="{$_sub_category_url}">{$subcategories_to_be_shown[i][1]}</a>
		 ({$subcategories_to_be_shown[i][2]})<br>
		{/section}</p>
		{/if}
		</div>
</div>

<center>
{if $products_to_show}

{*
 * @features "Products comparison"
*}
{include file="comparison_products_button.html"}
{*
 * @features
*}

{if $catalog_navigator}<p>{$catalog_navigator}</p>{/if}
{assign var=LineCounter value=1}
{assign var=LastProductGroup value=-1}
{assign var=ExtraFieldsCounter value=5}
<table width="100%" id="{$LastProductGroup}" border="0" cellpadding="0" cellspacing="0">
{foreach from=$products_to_show item=product_item name=product_brief}
	{if $LastProductGroup eq "-1"}
		{assign var=LastProductGroup value=$product_item.category_group}
<tr id="table_header">
	<th>Tch</th>
	<th>Артикул</th>
	<th>Наименование</th>
	{if $product_item.product_extra}
		{foreach from=$ExtraArray item=ExtraItem name=ExtraItem}
			{foreach from=$product_item.product_extra item=product_extra name=product_extra}
			{if $ExtraItem eq $product_extra.optionID}
				<th>{$product_extra.name_ru}</th>
				{assign var=ExtraFieldsCounter value=$ExtraFieldsCounter+1}
			{/if}
			{/foreach}
		{/foreach}
	{/if}
	<th>Цена опт</th>
	<th>Цена розница</th>
</tr>
	{/if}
	{if $LastProductGroup neq $product_item.category_group}
		{assign var=LineCounter value=1}
		<tr class="table_glist_tr">
			<td colspan="{$ExtraFieldsCounter}">&nbsp;</td>
		</tr>
	{/if}
	<tr id="{$product_item.productID}" class="table_glist_tr {if $LineCounter eq 1}dark{else}light{/if}">
	{include file="product_brief_list.tpl" product_info=$product_item}
	</tr>
	{assign var=LastProductGroup value=$product_item.category_group}
	{if $LineCounter eq 1}
		{assign var=LineCounter value=2}
	{else}
		{assign var=LineCounter value=1}
	{/if}
{/foreach}
</table>

{if $catalog_navigator}<p>{$catalog_navigator}</p>{/if}

{*
 * @features "Products comparison"
*}
{include file="comparison_products_button.html"}
{*
 * @features
*}

{else}
<p>
	{if $search_with_change_category_ability && !$advanced_search_in_category}
		&nbsp;
	{else}
		{if $advanced_search_in_category}
			&nbsp;&nbsp;&nbsp;&nbsp;< {"srch_no_matches_found"|translate} >
		{else}
			&nbsp;&nbsp;&nbsp;&nbsp;< {"str_empty_category"|translate} >
		{/if}
	{/if}
</p>
{/if}

</center>